﻿CREATE VIEW [dbo].[analysis_GetProjectCategoriesNullProjectID]
AS
SELECT DISTINCT 
                      dbo.Projects.ProjectID, dbo.ProjectCategories.ProjectID AS [PC.ProjID], dbo.ProjectCategories.CategoryID AS [PC.CatID], 
                      dbo.Projects.Name AS ProjectName, dbo.Categories.Name, dbo.Categories.IsActive, dbo.Categories.Abbreviation
FROM         dbo.ProjectCategories INNER JOIN
                      dbo.Categories ON dbo.ProjectCategories.CategoryID = dbo.Categories.CategoryID LEFT OUTER JOIN
                      dbo.Projects ON dbo.ProjectCategories.ProjectID = dbo.Projects.ProjectID
WHERE     (dbo.Projects.ProjectID IS NULL);

